//
//  HMSubscribeViewModel.m
//  HowToDo
//
//  Created by 宋轩 on 17/1/5.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMSubscribeViewModel.h"
#import "HMNetWorkTool.h"

#import "HMRecommendModel.h"

@implementation HMSubscribeViewModel

+ (void)getRecommendModelFinished:(void (^)(NSArray *arr ))finishedBlock Failed:(void (^)(NSError *))failedBlock
{
    [[HMNetWorkTool sharedTool] requestRecommendJsonDataFinished:^(id responseObject) {
        
        NSDictionary *jsonDict = responseObject;
        
        NSArray *jsonAray = jsonDict[@"data"];
        
        NSArray *newList = [NSArray yy_modelArrayWithClass:[HMRecommendModel class] json:jsonAray];
        
        finishedBlock(newList);
        
    } Failed:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

@end
